//Copyright (c) Microsoft Corporation.  All rights reserved.

#pragma once

namespace  Microsoft { namespace WindowsAPICodePack { namespace DirectX { namespace DirectWrite { 

/// <summary>
/// Specifies the type of DirectWrite factory object.
/// DirectWrite factory contains internal state such as font loader registration and cached font data.
/// In most cases it is recommended to use the shared factory object, because it allows multiple components
/// that use DirectWrite to share internal DirectWrite state and reduce memory usage.
/// However, there are cases when it is desirable to reduce the impact of a component,
/// such as a plug-in from an untrusted source, on the rest of the process by sandboxing and isolating it
/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed
/// component.
/// </summary>
public enum class DWriteFactoryType
{
    /// <summary>
    /// Shared factory allow for re-use of cached font data across multiple in process components.
    /// Such factories also take advantage of cross process font caching components for better performance.
    /// </summary>
    Shard = DWRITE_FACTORY_TYPE_SHARED,

    /// <summary>
    /// Objects created from the isolated factory do not interact with internal DirectWrite state from other components.
    /// </summary>
    Isolated = DWRITE_FACTORY_TYPE_ISOLATED
};



/// <summary>
/// The font weight enumeration describes common values for degree of blackness or thickness of strokes of characters in a font.
/// Font weight values less than 1 or greater than 999 are considered to be invalid, and they are rejected by font API functions.
/// </summary>
public enum class FontWeight
{
    /// <summary>
    /// Predefined font weight : Thin (100).
    /// </summary>
    Thin = DWRITE_FONT_WEIGHT_THIN,

    /// <summary>
    /// Predefined font weight : Extra-light (200).
    /// </summary>
    ExtraLight = DWRITE_FONT_WEIGHT_EXTRA_LIGHT,

    /// <summary>
    /// Predefined font weight : Ultra-light (200).
    /// </summary>
    UltraLight = DWRITE_FONT_WEIGHT_ULTRA_LIGHT,

    /// <summary>
    /// Predefined font weight : Light (300).
    /// </summary>
    Light = DWRITE_FONT_WEIGHT_LIGHT,

    /// <summary>
    /// Predefined font weight : Normal (400).
    /// </summary>
    Normal = DWRITE_FONT_WEIGHT_NORMAL,

    /// <summary>
    /// Predefined font weight : Regular (400).
    /// </summary>
    Regular = DWRITE_FONT_WEIGHT_REGULAR,

    /// <summary>
    /// Predefined font weight : Medium (500).
    /// </summary>
    Medium = DWRITE_FONT_WEIGHT_MEDIUM,

    /// <summary>
    /// Predefined font weight : Demi-bold (600).
    /// </summary>
    DemiBold = DWRITE_FONT_WEIGHT_DEMI_BOLD,

    /// <summary>
    /// Predefined font weight : Semi-bold (600).
    /// </summary>
    SemiBold = DWRITE_FONT_WEIGHT_SEMI_BOLD,

    /// <summary>
    /// Predefined font weight : Bold (700).
    /// </summary>
    Bold = DWRITE_FONT_WEIGHT_BOLD,

    /// <summary>
    /// Predefined font weight : Extra-bold (800).
    /// </summary>
    ExtraBold = DWRITE_FONT_WEIGHT_EXTRA_BOLD,

    /// <summary>
    /// Predefined font weight : Ultra-bold (800).
    /// </summary>
    UltraBold = DWRITE_FONT_WEIGHT_ULTRA_BOLD,

    /// <summary>
    /// Predefined font weight : Black (900).
    /// </summary>
    Black = DWRITE_FONT_WEIGHT_BLACK,

    /// <summary>
    /// Predefined font weight : Heavy (900).
    /// </summary>
    Heavy = DWRITE_FONT_WEIGHT_HEAVY,

    /// <summary>
    /// Predefined font weight : Extra-black (950).
    /// </summary>
    ExtraBlack = DWRITE_FONT_WEIGHT_EXTRA_BLACK,

    /// <summary>
    /// Predefined font weight : Ultra-black (950).
    /// </summary>
    UltraBlack = DWRITE_FONT_WEIGHT_ULTRA_BLACK
};

/// <summary>
/// The font stretch enumeration describes relative change from the normal aspect ratio
/// as specified by a font designer for the glyphs in a font.
/// Values less than 1 or greater than 9 are considered to be invalid, and they are rejected by font API functions.
/// </summary>
public enum class FontStretch
{
    /// <summary>
    /// Predefined font stretch : Not known (0).
    /// </summary>
    Undefined = DWRITE_FONT_STRETCH_UNDEFINED,

    /// <summary>
    /// Predefined font stretch : Ultra-condensed (1).
    /// </summary>
    UltraCondensed = DWRITE_FONT_STRETCH_ULTRA_CONDENSED,

    /// <summary>
    /// Predefined font stretch : Extra-condensed (2).
    /// </summary>
    ExtraCondensed = DWRITE_FONT_STRETCH_EXTRA_CONDENSED,

    /// <summary>
    /// Predefined font stretch : Condensed (3).
    /// </summary>
    Condensed = DWRITE_FONT_STRETCH_CONDENSED,

    /// <summary>
    /// Predefined font stretch : Semi-condensed (4).
    /// </summary>
    SemiCondensed = DWRITE_FONT_STRETCH_SEMI_CONDENSED,

    /// <summary>
    /// Predefined font stretch : Normal (5).
    /// </summary>
    Normal = DWRITE_FONT_STRETCH_NORMAL,

    /// <summary>
    /// Predefined font stretch : Medium (5).
    /// </summary>
    Medium = DWRITE_FONT_STRETCH_MEDIUM,

    /// <summary>
    /// Predefined font stretch : Semi-expanded (6).
    /// </summary>
    SemiExpanded = DWRITE_FONT_STRETCH_SEMI_EXPANDED,

    /// <summary>
    /// Predefined font stretch : Expanded (7).
    /// </summary>
    Expanded = DWRITE_FONT_STRETCH_EXPANDED,

    /// <summary>
    /// Predefined font stretch : Extra-expanded (8).
    /// </summary>
    ExtraExpanded = DWRITE_FONT_STRETCH_EXTRA_EXPANDED,

    /// <summary>
    /// Predefined font stretch : Ultra-expanded (9).
    /// </summary>
    UltraExpanded = DWRITE_FONT_STRETCH_ULTRA_EXPANDED
};

/// <summary>
/// The font style enumeration describes the slope style of a font face, such as Normal, Italic or Oblique.
/// Values other than the ones defined in the enumeration are considered to be invalid, and they are rejected by font API functions.
/// </summary>
public enum class FontStyle
{
    /// <summary>
    /// Font slope style : Normal.
    /// </summary>
    Normal = DWRITE_FONT_STYLE_NORMAL,

    /// <summary>
    /// Font slope style : Oblique.
    /// </summary>
    Oblique = DWRITE_FONT_STYLE_OBLIQUE,

    /// <summary>
    /// Font slope style : Italic.
    /// </summary>
    Italic = DWRITE_FONT_STYLE_ITALIC

};

/// <summary>
/// Direction for how reading progresses.
/// </summary>
public enum class ReadingDirection
{
    /// <summary>
    /// Reading progresses from left to right.
    /// </summary>
    LeftToRight = DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,

    /// <summary>
    /// Reading progresses from right to left.
    /// </summary>
    RightToLeft = DWRITE_READING_DIRECTION_RIGHT_TO_LEFT
};

/// <summary>
/// Direction for how lines of text are placed relative to one another.
/// </summary>
public enum class FlowDirection
{
    /// <summary>
    /// Text lines are placed from top to bottom.
    /// </summary>
    TopToBottom = DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM
};

/// <summary>
/// Alignment of paragraph text along the reading direction axis relative to 
/// the leading and trailing edge of the layout box.
/// </summary>
public enum class TextAlignment
{
    /// <summary>
    /// The leading edge of the paragraph text is aligned to the layout box's leading edge.
    /// </summary>
    Leading = DWRITE_TEXT_ALIGNMENT_LEADING,

    /// <summary>
    /// The trailing edge of the paragraph text is aligned to the layout box's trailing edge.
    /// </summary>
    Trailing = DWRITE_TEXT_ALIGNMENT_TRAILING,

    /// <summary>
    /// The center of the paragraph text is aligned to the center of the layout box.
    /// </summary>
    Center = DWRITE_TEXT_ALIGNMENT_CENTER
};

/// <summary>
/// Alignment of paragraph text along the flow direction axis relative to the
/// flow's beginning and ending edge of the layout box.
/// </summary>
public enum class ParagraphAlignment
{
    /// <summary>
    /// The first line of paragraph is aligned to the flow's beginning edge of the layout box.
    /// </summary>
    Near = DWRITE_PARAGRAPH_ALIGNMENT_NEAR,

    /// <summary>
    /// The last line of paragraph is aligned to the flow's ending edge of the layout box.
    /// </summary>
    Far = DWRITE_PARAGRAPH_ALIGNMENT_FAR,

    /// <summary>
    /// The center of the paragraph is aligned to the center of the flow of the layout box.
    /// </summary>
    Center = DWRITE_PARAGRAPH_ALIGNMENT_CENTER
};

/// <summary>
/// Word wrapping in multiline paragraph.
/// </summary>
public enum class WordWrapping
{
    /// <summary>
    /// Words are broken across lines to avoid text overflowing the layout box.
    /// </summary>
    Wrap = DWRITE_WORD_WRAPPING_WRAP,

    /// <summary>
    /// Words are kept within the same line even when it overflows the layout box.
    /// This option is often used with scrolling to reveal overflow text. 
    /// </summary>
    NoWrap = DWRITE_WORD_WRAPPING_NO_WRAP
};

/// <summary>
/// The method used for line spacing in layout.
/// </summary>
public enum class LineSpacingMethod
{
    /// <summary>
    /// Line spacing depends solely on the content, growing to accomodate the size of fonts and inline objects.
    /// </summary>
    Default = DWRITE_LINE_SPACING_METHOD_DEFAULT,

    /// <summary>
    /// Lines are explicitly set to uniform spacing, regardless of contained font sizes.
    /// This can be useful to avoid the uneven appearance that can occur from font fallback.
    /// </summary>
    Uniform = DWRITE_LINE_SPACING_METHOD_UNIFORM
};

/// <summary>
/// Text granularity used to trim text overflowing the layout box.
/// </summary>
public enum class TrimmingGranularity
{
    /// <summary>
    /// No trimming occurs. Text flows beyond the layout width.
    /// </summary>
    None = DWRITE_TRIMMING_GRANULARITY_NONE,

    /// <summary>
    /// Trimming occurs at character cluster boundary.
    /// </summary>
    Character = DWRITE_TRIMMING_GRANULARITY_CHARACTER,
    
    /// <summary>
    /// Trimming occurs at word boundary.
    /// </summary>
    Word = DWRITE_TRIMMING_GRANULARITY_WORD	
};

/// <summary>
/// The measuring method used for text layout.
/// </summary>
public enum class MeasuringMode
{
    /// <summary>
    /// Text is measured using glyph ideal metrics whose values are independent to the current display resolution.
    /// </summary>
    Natural = DWRITE_MEASURING_MODE_NATURAL,

    /// <summary>
    /// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution.
    /// </summary>
    GdiClassic = DWRITE_MEASURING_MODE_GDI_CLASSIC,

    /// <summary>
    /// Text is measured using the same glyph display metrics as text measured by GDI using a font
    /// created with CLEARTYPE_NATURAL_QUALITY.
    /// </summary>
    GdiNatural = DWRITE_MEASURING_MODE_GDI_NATURAL,
};


/// <summary>
/// Represents the internal structure of a device pixel (i.e., the physical arrangement of red,
/// green, and blue color components) that is assumed for purposes of rendering text.
/// </summary>
public enum class PixelGeometry
{
    /// <summary>
    /// The red, green, and blue color components of each pixel are assumed to occupy the same point.
    /// </summary>
    Flat = DWRITE_PIXEL_GEOMETRY_FLAT,

    /// <summary>
    /// Each pixel comprises three vertical stripes, with red on the left, green in the center, and 
    /// blue on the right. This is the most common pixel geometry for LCD monitors.
    /// </summary>
    Rgb = DWRITE_PIXEL_GEOMETRY_RGB,

    /// <summary>
    /// Each pixel comprises three vertical stripes, with blue on the left, green in the center, and 
    /// red on the right.
    /// </summary>
    Bgr = DWRITE_PIXEL_GEOMETRY_BGR
};

/// <summary>
/// Represents a method of rendering glyphs.
/// </summary>
public enum class RenderingMode
{
    /// <summary>
    /// Specifies that the rendering mode is determined automatically based on the font and size.
    /// </summary>
    Default = DWRITE_RENDERING_MODE_DEFAULT,

    /// <summary>
    /// Specifies that no anti-aliasing is performed. Each pixel is either set to the foreground 
    /// color of the text or retains the color of the background.
    /// </summary>
    Aliased = DWRITE_RENDERING_MODE_ALIASED,

    /// <summary>
    /// Specifies ClearType rendering with the same metrics as aliased text. Glyphs can only
    /// be positioned on whole-pixel boundaries.
    /// </summary>
    CleartypeGdiClassic = DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC,

    /// <summary>
    /// Specifies ClearType rendering with the same metrics as text rendering using GDI using a font
    /// created with CLEARTYPE_NATURAL_QUALITY. Glyph metrics are closer to their ideal values than 
    /// with aliased text, but glyphs are still positioned on whole-pixel boundaries.
    /// </summary>
    CleartypeGdiNatural = DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL,

    /// <summary>
    /// Specifies ClearType rendering with anti-aliasing in the horizontal dimension only. This is 
    /// typically used with small to medium font sizes (up to 16 ppem).
    /// </summary>
    CleartypeNatural = DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL,

    /// <summary>
    /// Specifies ClearType rendering with anti-aliasing in both horizontal and vertical dimensions. 
    /// This is typically used at larger sizes to makes curves and diagonal lines look smoother, at 
    /// the expense of some softness.
    /// </summary>
    CleartypeNaturalSymmetric = DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,

    /// <summary>
    /// Specifies that rendering should bypass the rasterizer and use the outlines directly. This is 
    /// typically used at very large sizes.
    /// </summary>
    Outline = DWRITE_RENDERING_MODE_OUTLINE
};

} } } }